package cn.springspace.kotlinapp.model

import lombok.Data
import java.io.Serializable
import javax.persistence.Embeddable

@Embeddable
@Data
@kotlinx.serialization.Serializable
class DoorKey(var id : Long = 1, var doorIndexCode : String = "") : Serializable {

    fun DoorKey(id: Long, doorIndexCode: String) {
        this.id = id
        this.doorIndexCode = doorIndexCode
    }

    override fun equals(other: Any?): Boolean {
        if (this === other) return true
        if (javaClass != other?.javaClass) return false

        other as DoorKey

        if (id != other.id) return false
        if (doorIndexCode != other.doorIndexCode) return false

        return true
    }

    override fun hashCode(): Int {
        var result = id.hashCode()
        result = 31 * result + doorIndexCode.hashCode()
        return result
    }


}